package com.xy.consumer.controller;

import com.xy.consumer.server.DeptClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ConsumerController {
    @Autowired
    DeptClientService deptClientService;

    @RequestMapping("/consumer/dept/get/{id}")
    public String getDept(@PathVariable(value = "id") Integer id) {
        String res = deptClientService.getDept(id);
        if (res == null || res.length() <= 0) {

        }
        return res;
    }

    @RequestMapping("/consumer/dept/list")
    public List listDept() {
        return deptClientService.getDeptList();
    }
}
